# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Daniel Bermond < yahoo-com: danielbermond >

pkgname=ffnvcodec-headers
pkgver=8.1.24.2
pkgrel=2
pkgdesc='FFmpeg version of headers required to interface with Nvidias codec APIs'
arch=('any')
url='https://git.videolan.org/?p=ffmpeg/nv-codec-headers.git'
license=('MIT')
source=("https://github.com/FFmpeg/nv-codec-headers/releases/download/n${pkgver}/nv-codec-headers-${pkgver}.tar.gz")
sha256sums=('2b339b2493f5b63b285dd660be05102af7d4ff2de9fcf3af94e48b5f91a3ca57')

build() {
  cd nv-codec-headers-n${pkgver}

  make PREFIX='/usr'
  sed -n '4,25p' include/ffnvcodec/nvEncodeAPI.h > LICENSE # Extract license
  sed -i '1,22s/^.\{,3\}//' LICENSE # Delete C comments
}

package() {
  cd nv-codec-headers-n${pkgver}

  make PREFIX='/usr' DESTDIR="${pkgdir}" install
  install -Dm 644 LICENSE -t "${pkgdir}"/usr/share/licenses/ffnvcodec-headers/
}

# vim: ts=2 sw=2 et:
